<script setup>
  // 导入中介
  import { ref } from 'vue';
import meipo from '../meipo.js'

  const msg = ref('')

  const send = () => {
    meipo.emit('toZhiNv', '我想你了~')
  }
  meipo.on('toNiuLang', (v, v2) => {
    msg.value = v
    console.log(v2);
    
  })
</script>

<template>
  <div class="my-left">
    <h3>牛郎</h3>
    <button @click="send">Send to ZhiNv</button>
    <p v-if="msg">{{ msg }} from ZhiNv</p>
  </div>
</template>

<style scoped>
  .my-left {
    flex: 1;
    align-items: center;
    align-content: center;
    text-align: center;
    height: 100px;
    background-color: #b4dd3a;
  }
</style>